<div class="modal fade in ip-box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true"
    id="newlyAdded">
    <div class="modal-dialog modal-lg-f modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">权限管理— 新增</h4>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            </div>
            <div class="modal-body">
                <form #newlyAddedForm="ngForm" (ngSubmit)="submitNewlyAdded(newlyAddedForm.value)">

                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 control-label text-right">权限编码：</label>
                        <div class="col-xs-12 col-sm-9">
                            <input type="text" name="operationCode" class="form-control" autocomplete="off" pattern="^[a-zA-Z_]+$"
                             required #operationCode="ngModel" placeholder="请输入权限编码,不能为汉字"ngModel>
                            <!-- pattern="^[^\u4e00-\u9fa5]{0,}$" -->
                            <label class="red required">*</label>
                            <div class="error" *ngIf="operationCode.invalid && (operationCode.touched)">
                                <small class="error" *ngIf="operationCode.errors.required">权限编码不能为空</small>
                                <small class="error" *ngIf="operationCode.errors.pattern">权限编码不能为汉字,特殊符号，允许输入_</small>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 control-label text-right">权限名称：</label>
                        <div class="col-xs-12 col-sm-9">
                            <input type="text" name="operationName" class="form-control" autocomplete="off" pattern="^[a-zA-Z\d\u4E00-\u9FA5_ ]+$"
                             required placeholder="请输入权限名称,输入英文和汉字" #operationName="ngModel"
                                ngModel>
                            <label class="red required">*</label>
                            <div class="error" *ngIf="operationName.invalid && (operationName.touched)">
                                <small class="error" *ngIf="operationName.errors.required">权限名称不能为空</small>
                                <small class="error" *ngIf="operationName.errors?.pattern ">不能输入特殊符号,允许输入空格和_</small>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 control-label text-right">是否启用：</label>
                        <div class="col-xs-12 col-sm-9">
                            <!-- <select name="enable" required #enable="ngModel" ngModel>
                                <option id="" value="">请选择</option>
                                <option id="" value="0">禁用</option>
                                <option id="" value="1" selected="">启用</option>
                            </select> -->
                            <label class="toggle toggle-positive">
                                <input type="checkbox" name="enable" #enable=ngModel [(ngModel)]="initial" />
                                <div class="track">
                                    <div class="tit" *ngIf="initial">启用</div>
                                    <div class="tit right" *ngIf="!initial">禁用</div>
                                    <div class="handle"></div>
                                </div>
                            </label>
                            <!-- <app-selection [data]="selecdata"></app-selection> -->
                        </div>
                    </div>

                    <div class="form-group height-auto">
                        <label class="col-xs-12 col-sm-3 control-label text-right">描述：</label>
                        <div class="col-xs-12 col-sm-9">
                            <textarea rows="5" type="text" name="description" class="form-control" maxlength="100" placeholder="描述" ngModel
                            placeholder="描述长度在0-50个汉字之间" minlength="0" maxlength="50">                                    
                            </textarea>
                        </div>
                    </div>
                    <div class="modal-footer" style="border: 0px solid #518199;width: 596px;">
                        <button type="button" class="btn btn-default" mat-raised-button data-dismiss="modal" (click)="reset()">取消</button>
                        <button type="submit" class="btn btn-primary" mat-button [disabled]="newlyAddedForm.invalid"><span class="glyphicon glyphicon-plus"></span> 新增</button>
                    </div>
                        
                </form>
            </div>
            
        </div>
    </div>
</div>